package cn.edu.scau.cmi.liquan.adapter;

import java.util.ArrayList;
import java.util.List;

public class AdapterOfClass extends SortUtil implements Target{
	@Override
	public List sortStudent(List<Student>studentList) {
		int count = 0;
		
		List<Integer>numList=new ArrayList<>();
		List<Student>students=new ArrayList<>();
		
		for(Student student : studentList) {
			numList.add(student.getNum());
			}
		numList=sortInt(numList);
		for(Integer num : numList) {
			count=0;
			while(count<=numList.size()) {
				if(studentList.get(count).getNum()==num)
				{
					students.add(new Student(num,studentList.get(count).getName()));
					break;
			}
				count++;
			}
		}
	    return students;
	}

}
